//
//  HYBaseFolderViewController.m
//  XPlayer
//
//  Created by liguoqing on 2023/9/8.
//

#import "HYBaseFolderViewController.h"

@implementation HYBaseFolderViewController

- (instancetype)initWithFolderViewModel:(HYHomeFileItemViewModel *)folderViewModel;
{
    self = [super init];
    if(self){
        self.folderViewModel = folderViewModel;
    }
    return self;
}

- (instancetype)initWithImportFileFolderIdentification:(NSString *)folderIdentification
                                             isPrivate:(BOOL)isPrivate
{
    self = [super init];
    if(self){
        self.isPrivate = isPrivate;
        self.folderIdentification = folderIdentification;
    }
    return self;
}

- (instancetype)initWithParentPath:(NSString *)parentPath 
                 currentfolderPath:(NSString *)currentfolderPath
                 currentfolderName:(NSString *)currentfolderName
{
    self = [super init];
    if(self){
        self.parentPath = parentPath;
        self.folderPath = currentfolderPath;
        self.folderName = currentfolderName;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = AppBgThemeColor;
    self.navigationBarView.titleLabel.text = self.folderViewModel.fileName;
}

- (void)fileChangeRefreshBlock:(dispatch_block_t)refreshBlock
{
    self.refreshBlock = refreshBlock;
}

#pragma mark - JXCategoryTitleView
- (JXCategoryTitleView *)myCategoryView
{
    JXCategoryTitleView *titleCategoryView = (JXCategoryTitleView *)self.categoryView;
    titleCategoryView.titleColor = APPTextThemeColor;
    titleCategoryView.titleSelectedColor = APPMainThemeColor;
    titleCategoryView.titleFont = kIsIPad?FONT_SIZE(16):FONT_SIZE(14);
    titleCategoryView.titleSelectedFont = kIsIPad?FONT_SIZE(16):FONT_SIZE(14);
    titleCategoryView.titleLabelZoomScale = 1.0;
    titleCategoryView.cellWidthZoomScale = 1.0;
    titleCategoryView.contentEdgeInsetLeft = 15;
    titleCategoryView.contentEdgeInsetRight = 15;
    titleCategoryView.cellSpacing = kIsIPad?35:25;
    titleCategoryView.averageCellSpacingEnabled = NO;
    titleCategoryView.titleColorGradientEnabled = NO;
    titleCategoryView.titleLabelMaskEnabled = YES;
    // 同时添加指示器线条、指示器 BackgroundView
    JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
    lineView.indicatorColor = APPMainThemeColor;
    lineView.indicatorWidth = 25;
    lineView.verticalMargin = 8;
    JXCategoryIndicatorBackgroundView *backgroundView = [[JXCategoryIndicatorBackgroundView alloc] init];
    backgroundView.indicatorHeight = 22;
    backgroundView.indicatorColor =  [CommUtls dynamicColorWithLightModeHex:@"#FFFFFF" darkModeHex:@"#3A3C42"];
    titleCategoryView.indicators = @[backgroundView,lineView];
    return titleCategoryView;
}

- (JXCategoryBaseView *)preferredCategoryView
{
    return [[JXCategoryTitleView alloc] init];
}


@end
